The content of a ODBC compliant database can be imported into XML
Instance, with each table's column headings modeled as either elements or
attributes. To select an ODBC source, enter its name (ask your database administrator if you need to find it, or check the ODBC control panel if you're running the database locally) and, if necessary, a username and
password (Figure A).
Figure A - Data Source Login
Once connected, a dialogue box will appear allowing you to select the tables and columns you would like to import. In figure B, all of the columns appearing in the dbo.Customers table have been selected for import, with each column name to be modeled as an element. The Data Typing drop down list allows you to specify which schema dialect you want to govern the data formatting of imported data. For example, data types of Boolean will be imported as "1" or "0" if the dialect is specified as DTD, XDR or XSD , but will be displayed as "true" or "false" if SOX is selected.
Figure B - ODBC import of entire table
In Figure C, a subset of the columns for the dbo.Customers tables has been selected. Hint: All columns can be selected at once by typing Ctrl-A. Holding down the Ctrl key when selecting also allows you to select multiple columns. A range of columns can be selected by holding down the shift key while clicking on the columns which mark the beginning and end of the desired range.
Figure C - ODBC import of selected columns
More sophisticated database imports can be achieved by specifying SQL statements. To enter a SQL query, check the Edit box to activate the SQL Statement area for input. In Figure D, a SQL statement has been entered to restrict the import to only those records in the dbo.Customers table which have London in the City column. Hint: The Paste buttons can be used to automatically add the selected table or column name to the SQL statement.
Figure D - Specifying a SQL statement
When you are finished selecting the tables and columns you would like to import, click on the Import button. XML Instance will import all records which match your query, modeling the table name as the parent element for the column names, with a top-level element called "root"(Figure E).
Figure E - ODBC import